package com.core.gig.negocio;


import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.DiscriminatorColumn;
import javax.persistence.DiscriminatorType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;


@Entity
@Table(name = "TB_MAT_PRIMA")
@SequenceGenerator(name = "SQ_MAT_PRIMA", sequenceName = "SQ_MAT_PRIMA")
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "TIPO", discriminatorType = DiscriminatorType.STRING, length = 1)
public class MateriaPrima implements Serializable
{

	private static final long serialVersionUID = -989209919746198611L;
	private int id;
	private String nome;
	private String fabricante;
	private String sigla;
	private double valor;

	@Id
	@Column (name = "ID")
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SQ_MAT_PRIMA")
	public int getId()
	{
		return id;
	}

	@Column(name = "NOME", nullable = false, length = 100)
	public String getNome()
	{
		return nome;
	}

	@Column(name = "FABRICANTE", nullable = true, length = 100)
	public String getFabricante()
	{
		return fabricante;
	}

	@Column(name = "SIGLA", nullable = false, length = 10)
	public String getSigla()
	{
		return sigla;
	}

	@Column(nullable = false, precision = 2)
	public double getValor()
	{
		return valor;
	}

	public void setId(int id)
	{
		this.id = id;
	}

	public void setNome(String nome)
	{
		this.nome = nome;
	}

	public void setFabricante(String fabricante)
	{
		this.fabricante = fabricante;
	}

	public void setSigla(String sigla)
	{
		this.sigla = sigla;
	}

	public void setValor(double valor)
	{
		this.valor = valor;
	}
}